<template>
  <div id="home">
    <li @click="routeChapter(1)">
      第一章
    </li>
    <li @click="routeChapter(2)">
      第二章
    </li>
    <li @click="routeChapter(3)">
      第三章
    </li>
    <li @click="routeChapter(4)">
      第四章
    </li>
  </div>
</template>

<script lang="ts">
import { defineComponent, onMounted, ref } from "vue";
import {useRouter} from "vue-router"
export default defineComponent({
  name:"Home",
  setup(){
    const router = useRouter()

    function routeChapter(num){
      router.push({
        path:"/chapter-"+num
      })
    }

    return {
      routeChapter:routeChapter
    }
  }
})
</script>

<style scoped>

</style>